<%--
 *  File:    BookSetEdit.jsp
 *  @Author: jianni
 *  Date:    2002/01/28
 *  @Modify by:    Andy Yang
 *  Modify Date:   2002/10/16
 *
 *  Copyright (C) 2000 - 2002 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>


<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<% //--------------------------------------  setting logger --%>
<%
  	Category cat = Category.getInstance("jsp.BookSetEdit");
%>

<% //--------------------------------------  variant and initialization --%>
<%
  	String strModuleName = "SPM";
  	String privilegeCode = "40104";
%>



<%
  	boolean bIsNew = false;
  	if(request.getParameter("booksetid") == null)
  	{
    	bIsNew = true;
  	}
  	HashMap userInfo = (HashMap)session.getAttribute("userinfo");
  	String booksetId = "";
    	String booksetCode = "";
    	String booksetName = "";
    	String beginDate = "";
    	String accPeriodNum = "";
    	String beginDay = "";
    	String endDay = "";
    	String status = "";
    	String accperiodtype = "1";
    	String readonly = "";
    	String isChecked1 = "checked";
    	String isChecked2 = "";
    	String isChecked3 = "";
    	String isChecked21 = "";
  	String isChecked22 = "";
    	String selected0 = "";
    	String selected1 = "";
    	String selected2 = "";
    	String selected3 = "";
    	String selected4 = "";
    	String flagChecked = "";
    	String saccperiodnum1 = "";
    	String saccperiodnum11 = "";
    	String saccperiodnum2 = "";
    	String ssegmentdatenum = "";
    	String sperioddays = "";
    	Integer accperiodnum1 = null;
    	Integer accperiodnum11 = null;
    	Integer accperiodnum2 = null;
    	Integer segmentdatenum = null;
    	Integer perioddays = null;
    	Integer beginMonth = null;
    	Integer endMonth = null;
    	String [] strBMSelect = {"", "", "", "", "", "", "", "", "", "", "", ""};
    	String [] strEMSelect = {"", "", "", "", "", "", "", "", "", "", "", ""};
%>

<% //--------------------------------------  include files list --%>
<%@ include file="/inc/Security.inc" %>
<%@ include file="/inc/PageDefault.inc" %>

<%!
	boolean isLeapYear(int m_year)
	{
		int year;
		year = m_year;

		if (year%400 == 0)
		{
			return true;
		}else if (year%4==0 && year%100!=0)
		{
			return true;
		}else
		{
			return false;
		}
	}
%>

<html>
<head>
<title></title>
<PageFlow:CheckPageFlow pageName="booksetedit"/>
<%@ include file="/inc/InitEdit.inc" %>
<%@ include file="/inc/CatchError.inc" %>

<% //--------------------------------------  output variant from pageflow --%>
<%

	HashMap bookset = null;
	if(!bIsNew)
	{
	    bookset = (HashMap)pageContext.getAttribute("booksetinfo");
    	}
    	if(bookset == null)
  	{
    	    bookset = new HashMap();
  	}
  	else
  	{
  	    booksetId = (bookset.get("booksetid")).toString();
	    booksetCode = (bookset.get("booksetcode")).toString();
	    booksetName = (bookset.get("booksetname")==null ? "" : (bookset.get("booksetname")).toString());
	    beginDate = ((bookset.get("begindate")==null)? "" :(OvalTools.dateToString((java.sql.Date)bookset.get("begindate"),(String)session.getAttribute("dateformat"))));
	    accPeriodNum = (bookset.get("accperiodnum")==null ? "" : (bookset.get("accperiodnum")).toString());
	    beginMonth = (Integer)bookset.get("beginmonth");
	    if(beginMonth!=null && beginMonth.intValue()<13)
	    	strBMSelect[beginMonth.intValue()-1] = "selected";

	    beginDay = (bookset.get("beginday")==null ? "" : (bookset.get("beginday")).toString());
	    endMonth = (Integer)bookset.get("endmonth");
	    if(endMonth!=null && endMonth.intValue()<13)
	    	strEMSelect[endMonth.intValue()-1] = "selected";

	    endDay = (bookset.get("endday")==null ? "" : (bookset.get("endday")).toString());
	    status = (bookset.get("status")==null ? "" : (bookset.get("status")).toString());

	    readonly = "readonly";

	    if(bookset.get("accperiodtype")!=null)
	    {
	      accperiodtype=(String)bookset.get("accperiodtype");
	      if(accperiodtype.equals("2"))
	      {
	      	isChecked1 = "";
	      	isChecked2 = "checked";
	      	accperiodnum1= (Integer)bookset.get("accperiodnum");
	      	segmentdatenum=(Integer)bookset.get("segmentdatenum");
	      	perioddays=new Integer((365-segmentdatenum.intValue())/(accperiodnum1.intValue()-1));
	      	if(perioddays.intValue()==segmentdatenum.intValue())
	      	{
	      	  isChecked21 = "checked";
	      	  accperiodnum11=accperiodnum1;
	      	}else if(segmentdatenum.intValue() >= perioddays.intValue())
	      	{
	      	  isChecked21 = "checked";
	      	  accperiodnum11=new Integer(accperiodnum1.intValue()+1);
	      	}else
    		{
      		  isChecked22 = "checked";
      		  accperiodnum11 = accperiodnum1;
      		  accperiodnum1 = new Integer(accperiodnum1.intValue()-1);
    		}
		saccperiodnum1 = accperiodnum1.toString();
		saccperiodnum11 = accperiodnum11.toString();
		ssegmentdatenum = segmentdatenum.toString();
		sperioddays = perioddays.toString();
	      }else if(accperiodtype.equals("3"))
	      {
	      	isChecked1 = "";
	      	isChecked3 = "checked";
	      	accperiodnum2= (Integer)bookset.get("accperiodnum");
	      	saccperiodnum2 = accperiodnum2.toString();
	      }
	    }
	    if(bookset.get("importglaccflag")!=null&&((String)bookset.get("importglaccflag")).equals("1"))
	    {
	     	flagChecked="checked";
	    }
	    if(bookset.get("specialaccperiodnum")!=null)
	    {
	      Integer specialaccperiodnum = (Integer)bookset.get("specialaccperiodnum");
	      if(specialaccperiodnum.intValue()==1)
	      {
	        selected1="selected";
	      }else if(specialaccperiodnum.intValue()==2)
	      {
	        selected2="selected";
	      }else if(specialaccperiodnum.intValue()==3)
	      {
	        selected3="selected";
	      }else if(specialaccperiodnum.intValue()==4)
	      {
	        selected4="selected";
	      }else
	      {
	        selected0="selected";
	      }
	    }
  	}
%>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="../../js/FuncLib.js"></script>
<script language="JavaScript" src="../../js/ScriptLib.js"></script>
<%@ include file="/inc/NewCalendar.inc" %>
<script language="JavaScript">

<%
GregorianCalendar rightNow = new GregorianCalendar();
if(rightNow.isLeapYear((new Date()).getYear())){
%>
var month =[0,31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
<%}else{%>
var month =[0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
<%}%>
function page_done()
{
	if(frm.ownerorgid.value==''||frm.ownerorgid.value==-1)
	{
	  alert("<%= message.getMessageDesc("MUST_SELECT_FIRST", label.getLabelName("L_OwnerOrg1",false)) %>");
    	  return;
	}
	if(!IsPosInteger(Number(document.frm.accperiodnum.value) + 1))
	{
	  alert("<%= message.getMessageDesc("VALUE_MUST_BE_NON_NEG_INT", label.getLabelName("L_NoOfAP",false)) %>");
    	  return;
	}
	if(document.frm.beginday.value>month[document.frm.beginmonth.value] || document.frm.endday.value>month[document.frm.endmonth.value])
	{
		alert(replaceString("<%= message.getMessageDesc("VALUE_MUST_BETWEEN",label.getLabelName("L_Sun",false))%>",0,month[document.frm.beginmonth.value]));
		return;
	}

 	if(!checkForm(frm)) return;
  	formatNumber(frm);

 	if(frm.accperiodtype.value==1)
 	{
 	  frm.accperiodnum.value=12;
 	  frm.segmentdatenum.value=0;
 	  <%--[SCRIPT]  if(frm.space.value=='') frm.space.value=0;  [SCRIPT]--%>
 	  <%--[SCRIPT]  if(frm.accperiodnum3.value=='') frm.accperiodnum3.value=0;  [SCRIPT]--%>
 	}else if(frm.accperiodtype.value==2)
 	{
 	  frm.accperiodnum.value=frm.myaccperiodnum.value;
 	  frm.segmentdatenum.value=frm.segmentdatenum1.value;
 	}else if(frm.accperiodtype.value==3)
 	{
 	  if(frm.accperiodnum3.value=='')
 	  {
 	    alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_Accountant",false)+label.getLabelName("L_AccPeriodNum",false)) %>");
 	    return;
 	  }
 	  if(!isNumber(frm.accperiodnum3.value))
 	  {
 	    alert("<%= message.getMessageDesc("VALUE_MUST_BE_NUMBER",label.getLabelName("L_Accountant",false)+label.getLabelName("L_AccPeriodNum",false)) %>");
 	    frm.accperiodnum3.focus();
 	    return;
 	  }
 	  frm.accperiodnum.value=frm.accperiodnum3.value;
 	  frm.segmentdatenum.value=0;
 	  <%--[SCRIPT]  if(frm.space.value=='') frm.space.value=0;  [SCRIPT]--%>
 	  <%--[SCRIPT]  if(frm.accperiodnum3.value=='') frm.accperiodnum3.value=0;  [SCRIPT]--%>
 	}

 	document.frm.actionname.value = "done";
 	isRunning = true;
 	document.frm.submit();
}
function changeBeginDay()
{
	if(!isNumber(document.frm.beginday.value))
	{
		alert("<%= message.getMessageDesc("VALUE_MUST_BE_NUMBER",label.getLabelName("L_Sun",false)) %>");
		document.frm.beginday.focus();
		return;
	}
	if(document.frm.beginday.value>month[document.frm.beginmonth.value] || document.frm.beginday.value <= 0)
	{
		alert(replaceString("<%= message.getMessageDesc("VALUE_MUST_BETWEEN",label.getLabelName("L_Sun",false))%>","%s",0,month[document.frm.beginmonth.value]));
		document.frm.beginday.focus();
		return;
	}
	var endday = document.frm.beginday.value - 1;
	var endmonth = document.frm.beginmonth.value;
	if(endday == 0)
	{
	  endmonth --;
	  if(endmonth == 0)
	    endmonth += 12;
	  endday = month[endmonth];
	}
	document.frm.endmonth.value = endmonth;
	document.frm.endday.value = endday;
}
function setAccPeriodType(typevalue)
{
	frm.accperiodtype.value=typevalue;
	if(typevalue==2&&frm.space.value=='')
	{
	  frm.space.value=30;
	  frm.num1.value=12;
	  frm.num2.value=13;
	  frm.segmentdatenum1.value=35;
	}
	if(typevalue==3&&frm.accperiodnum3.value=='')
	{
	  frm.accperiodnum3.value=12;
	}
}
function changeSpace()
{
	if(frm.space.value=='')
 	{
 	  alert("<%= message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_PeriodDays",false)) %>");
 	  return;
 	}
	if(frm.space.value>365)
	{
	    alert("<%= message.getMessageDesc("VALUE_NOT_MORETHAN",label.getLabelName("L_PeriodDays",false),"365") %>");
 	    frm.space.focus();
 	    return;
	}
	if(!isNumber(frm.space.value))
	{
	    alert("<%= message.getMessageDesc("VALUE_MUST_BE_NUMBER",label.getLabelName("L_PeriodDays",false)) %>");
	    frm.space.value=30;
	    frm.num1.value=12;
	    frm.num2.value=13;
	    frm.segmentdatenum1.value=35;
 	    frm.space.focus();
 	    return;
	}
	if(365%frm.space.value!=0)
	{
	  frm.segmentdatenum1.value=Number(365%frm.space.value)+Number(frm.space.value);
	  frm.num1.value=Number(365/(frm.space.value))-Number(365/(frm.space.value)%1);
	  frm.num2.value=Number(frm.num1.value)+1;
	}else
	{
	  frm.num1.value=365/frm.space.value;
	  frm.num2.value=frm.num1.value;
	  frm.segmentdatenum1.value=frm.space.value;
	}
}
function setSegmentdateNum(flag)
{
   if(365%frm.space.value!=0)
   {
	if(flag==1)
	{
	  frm.segmentdatenum1.value=Number(365%frm.space.value)+Number(frm.space.value);
	  frm.myaccperiodnum.value=frm.num1.value;
	}else if(flag==2)
	{
	  frm.segmentdatenum1.value=365%frm.space.value;
	  frm.myaccperiodnum.value=frm.num2.value;
	}
   }
}
function page_selectorgpop()
{
    var strurl="../../masterdata/ogm/OrgSelect.jsp?<%= OvalTools.randomURL() %>&selectoption=owner&orgid=<custom:write name="userinfo" scope="session"  property="orgid"/>";
    var strstatus="height=250, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no";
    if(popwindow!=null)
        popwindow.close();
    popwindow = window.open(strurl,"newwindows" ,strstatus);
}
function page_setOrg(orgid,orgname,orgcode,shortname)
{
    frm.ownerorgid.value=orgid;
    frm.shortname.value=shortname;
    frm.orgcode.value=orgcode;
    if(popwindow!=null)
        popwindow.close();
}
function changeGLAccountList()
{
  if(frm.glaccountlistid.value=='-1')
  {
  	document.all.description.innerText = ' ';
  	return;
  }
  document.all.glaccountstructure.innerText = frm.glaccountlistid1.options[frm.glaccountlistid.selectedIndex].value;
  if(frm.glaccountlistid1.options[frm.glaccountlistid.selectedIndex].innerText!='')
  	document.all.description.innerText = frm.glaccountlistid1.options[frm.glaccountlistid.selectedIndex].innerText;
}
</script>
</head>

<body onload="changeGLAccountList();">

	<% //--------------------------------------  hidden form variant --%>
    <form name="frm" method="post" action="../../Dispatcher" target="_parent">
    	<input type="hidden" name="pagename" value="booksetedit">
    	<input type="hidden" name="actionname">

    <%if(booksetId.length()!=0){%>
    	<input type="hidden" name="booksetid" value="<%=JspHelper.filterNull( booksetId )%>">
    	<input type="hidden" name="status" value="<%=JspHelper.filterNull( status )%>">

    <%} else { %>
    	<input type="hidden" name="status" value="27">
    <% }%>
    	<input type="hidden" name="orgid" value="<%=JspHelper.filterNull( userInfo.get("orgid"))%>">
    	<input type="hidden" name="languagecode" value="<%= strLanguageCode %>">
    	<input type="hidden" name="accperiodtype" value="<%=JspHelper.filterNull( accperiodtype )%>">
    	<input type="hidden" name="accperiodnum" >
    	<input type="hidden" name="segmentdatenum" >
        <input type="hidden" name="booksettype" value="1">

	<table width="100%" cellspacing="0" border="0" cellpadding="0">
  	<tr>
    	<td>

      		<table width="100%" cellspacing="0" cellpadding="0">
        	<tr>
          		<td colspan="2" class="summary_top"></td>
        	</tr>
        	<tr>
          		<td colspan="2"><img src="../../images/<%= strLanguageCode %>/quote.gif" width="16" height="11">
            		<%= label.getLabelName("L_NEBookset") + label.getLabelName("L_Colon") %></td>
        	</tr>
      		</table>

      		<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
        	<tr>
          		<td class="need" width="110"><%= label.getLabelName("L_BooksetCode") + label.getLabelName("L_Colon") %></td>
          		<td width="300"><input type="text" name="booksetcode" size="20" value="<%=JspHelper.filterNull( booksetCode)%>" <%=JspHelper.filterNull( readonly )%> command="notnull" label="<%= label.getLabelName("L_BooksetCode",false) %>" ></td>
          		<td class="need"><%= label.getLabelName("L_BooksetName") + label.getLabelName("L_Colon") %></td>
          		<td><input type="text" name="booksetname" size="40" value="<%=JspHelper.filterNull( booksetName)%>" command="notnull" label="<%= label.getLabelName("L_BooksetName",false) %>"></td>
        	</tr>
        	<tr>
          		<td class="need"><%= label.getLabelName("L_OwnerOrg1") + label.getLabelName("L_Colon") %></td>
          		<td>
            			<custom:select optionsName="orghash" defaultValue="----------------" optionValueKey="orgid" optionInnerTextKey="orgname" name="booksetinfo" property="ownerorgid" module="SPM" label="L_OwnerOrg1" command="notnull"/>
          		</td>
          		<td class="need"><%= label.getLabelName("L_BeginningDate") + label.getLabelName("L_Colon") %></td>
          		<td>
          			<input type="text" name="begindate0" size="20" value="<%=JspHelper.filterNull( beginDate )%>" command="notnull" label="<%= label.getLabelName("L_BeginningDate",false) %>" onblur="begindate.value=dateCheck(begindate0.value,'yyyy-MM-dd','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>');if(begindate.value<0){alert('<%= message.getMessageDesc("VALUE_MUST_BE_DATE", label.getLabelName("L_BeginningDate",false)) %>');begindate0.focus();}">
          			<a onclick="javascript:c.show(this,'frm.begindate0','<%=JspHelper.filterNull( session.getAttribute("dateformat") )%>')"><custom:button type="3" label="L_Asterisk" imgsrc="Time.gif" border="0"/></a>
             			<input type="hidden" name="begindate" value="<custom:write name="booksetinfo" property="begindate"/>">
          		</td>
        	</tr>
        	<tr>
          		<td class="need"><%= label.getLabelName("L_BeginningMonth") + label.getLabelName("L_Colon") %> </td>
          		<td>
            		<select name="beginmonth">
            			<% for(int i=1;i<13;i++) {  %>
              			<option value="<%=JspHelper.filterNull( i )%>" <%=JspHelper.filterNull( strBMSelect[i-1])%> ><%=JspHelper.filterNull( i )%></option>
              			<% } %>
		            </select>
            		<%=((strLanguageCode.equalsIgnoreCase("cn"))?label.getLabelName("L_Month"):("/")) %>
            		<input type="text" name="beginday" onchange="javascript:changeBeginDay()" size="4" value="<%=JspHelper.filterNull( beginDay )%>" command="notnull" label="<%= label.getLabelName("L_Sun",false)%>">
            		<%=((strLanguageCode.equalsIgnoreCase("cn"))?label.getLabelName("L_Day"):("/")) %>
            		</td>
            		<td class="need"><%= label.getLabelName("L_EndingMonth") + label.getLabelName("L_Colon") %></td>
          		<td>
		            <input type="text" name="endmonth" size="4" style="border:0" readonly value="<%=JspHelper.filterNull( endMonth )%>" command="notnull" label="<%= label.getLabelName("L_Sun",false)%>">
		            <%=((strLanguageCode.equalsIgnoreCase("cn"))?label.getLabelName("L_Month"):("/")) %>
		            <input type="text" name="endday" size="4" style="border:0" readonly value="<%=JspHelper.filterNull( endDay)%>" command="notnull" label="<%= label.getLabelName("L_Sun",false)%>">
		            <%=((strLanguageCode.equalsIgnoreCase("cn"))?label.getLabelName("L_Day"):("/")) %>
		      	</td>
        	</tr>
        	<tr>
          		<td class="need"><%= label.getLabelName("L_HomeCurrency") + label.getLabelName("L_Colon") %> </td>
          		<td colspan="3">
            		<custom:select optionsName="allcurrency" optionValueKey="currencycode" optionInnerTextKey="currencyname" name="booksetinfo" property="currencycode"/>
          		</td>
        	</tr>
      		</table>

      		<table width="100%" cellspacing="0" cellpadding="0">
                <tr>
                    	<td colspan="2" class="summary_top"></td>
                </tr>
                <tr>
                    	<td colspan="2"><img src="../../images/<%= strLanguageCode %>/quote.gif" width="16" height="11">
                        <%= label.getLabelName("L_SetAP") + label.getLabelName("L_Colon") %></td>
                </tr>
                </table>
            	<table width="100%" border="1" cellpadding="1" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
                <tr>
                    	<td class="td-text" rowspan="6"><%= label.getLabelName("L_Normal") + label.getLabelName("L_AccountPeriod") +label.getLabelName("L_Colon") %></td>
                    	<td width="22">
                            <input type="radio" name="radiobutton" value="1" class="checkbox" <%=JspHelper.filterNull(isChecked1)%> onclick="javascript:setAccPeriodType(1)" >
                    	</td>
                    	<td colspan="4"><%= label.getLabelName("L_Nature") + label.getLabelName("L_Month") %></td>
                </tr>
                <tr>
                    	<td rowspan="3">
                            <input type="radio" name="radiobutton" value="2" class="checkbox" <%=JspHelper.filterNull(isChecked2)%> onclick="javascript:setAccPeriodType(2)">
                    	</td>
                    	<td colspan="4"><%= label.getLabelName("L_PBES") %></td>
                </tr>
                <tr>
                    	<td width="108"><%= label.getLabelName("L_PeriodDays")+label.getLabelName("L_Colon") %></td>
                    	<td width="80">
                            <custom:text property="space" value="<%=sperioddays%>" module="SPM" label="L_PeriodDays" dataType="number" dataFormatName="amountformat" size="4" onchange="javascript:changeSpace()"/>
                    	</td>
                    	<td width="80"><%= label.getLabelName("L_AccPeriodNum")+label.getLabelName("L_Colon") %></td>
                    	<td>
                        <input type="radio" name="radiobutton1" value="12" class="checkbox" <%=JspHelper.filterNull(isChecked21)%> onClick="javascript:setSegmentdateNum(1)" >
                        <input type="text" name="num1" value="<%=JspHelper.filterNull(saccperiodnum1)%>" style="border:0"  size="4" readonly="true">
                        <input type="radio" name="radiobutton1" value="13" class="checkbox" <%=JspHelper.filterNull(isChecked22)%> onClick="javascript:setSegmentdateNum(2)">
                        <input type="text" name="num2" value="<%=JspHelper.filterNull(saccperiodnum11)%>" style="border:0" size="4" readonly="true">
                        <input type="hidden" name="myaccperiodnum" value=12>
                        </td>
                </tr>
                <tr>
                    	<td colspan="4"><%= label.getLabelName("L_LastAPDays")+label.getLabelName("L_LeftBracket")+label.getLabelName("L_Not")+label.getLabelName("L_LeapYear")+label.getLabelName("L_RightBracket")+label.getLabelName("L_Colon") %>
                    	<custom:text property="segmentdatenum1" style="border:0" readonly="true" value="<%=ssegmentdatenum%>"/>
                    	</td>
                </tr>
                <tr>
                    	<td rowspan="2">
                            <input type="radio" name="radiobutton" value="3" class="checkbox" <%=JspHelper.filterNull(isChecked3)%> onClick="javascript:setAccPeriodType(3)">
                    	</td>
                    	<td colspan="4"><%= label.getLabelName("L_RandomPeriodNum")%></td>
                </tr>
                <tr>
                    	<td><%= label.getLabelName("L_Accountant")+label.getLabelName("L_AccPeriodNum")+label.getLabelName("L_Colon") %></td>
                    	<td colspan="3">
                            <custom:text property="accperiodnum3" value="<%=saccperiodnum2%>" module="SPM" label="L_AccPeriodNum" dataType="number" dataFormatName="amountformat" size="4"/>
                    	</td>
                </tr>
                <tr>
                    	<td class="td-text" width="110"><%= label.getLabelName("L_SpecialPeriodNum")+label.getLabelName("L_Colon") %></td>
                    	<td colspan="5">
                        <select name="specialaccperiodnum">
                            <option value="0"<%=JspHelper.filterNull(selected0)%>>----</option>
                            <option value="1" <%=JspHelper.filterNull(selected1)%>>1</option>
                            <option value="2" <%=JspHelper.filterNull(selected2)%>>2</option>
                            <option value="3" <%=JspHelper.filterNull(selected3)%>>3</option>
                            <option value="4" <%=JspHelper.filterNull(selected4)%>>4</option>
                        </select>
                    	</td>
                </tr>
            	</table>

            	<table width="100%" cellspacing="0" cellpadding="0">
                <tr>
                    	<td colspan="2" class="summary_top"></td>
                </tr>
                <tr>
                    	<td colspan="2"><img src="../../images/<%= strLanguageCode %>/quote.gif" width="16" height="11">
                        <%= label.getLabelName("L_AccounterAccInfo")+label.getLabelName("L_Colon") %></td>
                </tr>
            	</table>
            	<table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
                <tr>
                 	<td class="need" width="110"><%= (new OvalLabel(strLanguageCode,"GL")).getLabelName("L_GLAccountList")+label.getLabelName("L_Colon")%></td>
                  <td width="100">
                    <custom:select name="booksetinfo" property="glaccountlistid" style="width:100%" optionsName="glaccountlistvect" optionValueKey="glaccountlistid" optionInnerTextKey="glaccountlistcode" defaultValue="----------------" onchange="changeGLAccountList();" module="GL" label="L_GLAccountList" command="notnull"/>
                    <custom:select property="glaccountlistid1" style="display:none" optionsName="glaccountlistvect" optionValueKey="glaccountstructure" optionInnerTextKey="description" defaultValue="----------------"/>
                  </td>
                  <td width="200"><span id="description">&nbsp;</span></td>
                  <td width="110" class="td-text"><%= (new OvalLabel(strLanguageCode,"GL")).getLabelName("L_GLAccountStructure") + label.getLabelName("L_Colon")%></td>
                  <td>&nbsp;<span id="glaccountstructure"/></td>
                </tr>
            	</table>
    	</td>
  	</tr>

  	<% //--------------------------------------------------------------  operation button --%>
  	<tr>
    	<td class="summary_top"></td>
  	</tr>
  	<tr>
    	<td class="td_center">
    		<a onclick="page_done()"><custom:button type="1" label="L_Finish" imgsrc="finish.gif" border="0" style="width:60"/></a>
    		<a onclick="self.location.href='Blank.jsp?<%= OvalTools.randomURL() %>';"><custom:button type="1" label="L_Cancel" imgsrc="cancel.gif" border="0" style="width:60"/></a>
    	</td>
  	</tr>

	</table>
	</form>
</body>
<script>
	formatNumber(frm);
</script>
</html>


